]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
WindowManager: scale windows to their monitor's corner on minimize
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 15 Dec 2012 02:24:23 +0000 (03:24 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 16 Dec 2012 21:40:33 +0000 (22:40 +0100)
We previously scaled windows to (primary.x, 0), which is wrong if the
primary monitor is not at y == 0. At the same time, change the policy
to pick the hot corner on the monitor the window is on, because that's
closest to where it will appear in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=690241

js/ui/windowManager.js

index 372d9a30370db10d44295c06858cc9bb54961df9..60e0837ae2f25da369f7d666774455c529148963 100644 (file)
@@ -247,16 +247,17 @@ const WindowManager = new Lang.Class({
          */
         this._minimizing.push(actor);
 
-        let primary = Main.layoutManager.primaryMonitor;
-        let xDest = primary.x;
+        let monitor = Main.layoutManager.findMonitorForWindow(actor.meta_window);
+        let xDest = monitor.x;
+        let yDest = monitor.y;
         if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
-            xDest += primary.width;
+            xDest += monitor.width;
 
         Tweener.addTween(actor,
                          { scale_x: 0.0,
                            scale_y: 0.0,
                            x: xDest,
-                           y: 0,
+                           y: yDest,
                            time: WINDOW_ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onComplete: this._minimizeWindowDone,